I'm new to DXL so please bear with me a bit...
I'm trying to convert a real or int value to a string but I can't find any clean way to do it. There doesn't seem to be a stringOf(real|int) function, which would be kind of handy. What I've been able to do to make it work is to do a concatenation and retrieve the string result from that but it just doesn't settle well.... it goes something like this:
real myDecimal = 1.1;
string decimalString = myDecimal "";
print decimalString;
I know you don't have to do this for the print function but other functions do require strings (e.g. field). Is there a better way?
-Rick
SystemAdmin - Wed Dec 03 04:52:07 EST 2008 |
|
Re: Newbie question dpechacek - Wed Dec 03 08:15:06 EST 2008
That is the main way DXL converts types to strings. There are stringOf() functions for some types (Buffers). But in general just concatenate the number with the empty string or another string.
AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
|
|
Re: Newbie question SystemAdmin - Wed Dec 03 12:39:45 EST 2008 dpechacek - Wed Dec 03 08:15:06 EST 2008
That is the main way DXL converts types to strings. There are stringOf() functions for some types (Buffers). But in general just concatenate the number with the empty string or another string.
AAI Services, Textron
dpechacek@sc-aaicorp.com
David.Pechacek@gmail.com
Thanks David. I guess it's time for me to start writing some helper functions to clean up things like this. It's not that this is difficult, I just prefer to have more consistency in how type conversions are done.
-Rick
|
|
Re: Newbie question kbmurphy - Thu Dec 04 12:04:36 EST 2008 SystemAdmin - Wed Dec 03 12:39:45 EST 2008
Thanks David. I guess it's time for me to start writing some helper functions to clean up things like this. It's not that this is difficult, I just prefer to have more consistency in how type conversions are done.
-Rick
And the ; statement ending is optional....
|
|
Re: Newbie question SystemAdmin - Wed Dec 10 01:11:14 EST 2008 kbmurphy - Thu Dec 04 12:04:36 EST 2008
And the ; statement ending is optional....
Understood. I spend most of my time working in C++ or Javascript so DXL is a bit of a chore for me. If I can make it look more like what I'm used to then it takes a load off my brain to process what I'm working on.
|
|